package com.by.goods.controller;


import com.by.common.core.bean.ResultBean;
import com.by.common.core.response.R;
import com.by.goods.entity.Spu;
import com.by.goods.service.SpuService;
//import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@Tag(name = "spu管理", description = "spu的增删改查")
@RestController
@RequestMapping("/api/v1")
public class SpuController {

    @Autowired
    SpuService spuService;

    @PostMapping("/spu")
    public ResultBean save(@RequestBody Spu spu) {
        boolean rs = spuService.save(spu);
        return rs ? R.success("保存成功") : R.fail("保存失败");
    }
}
